package com.example.springiocdemo.Demo;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

public class Demo02 {
    public static void main(String[] args) {
        Tire tire = new Tire(10);
        Bottom bottom = new Bottom(tire);
        Framework framework = new Framework(bottom);
        Car car = new Car(framework);
    }

    static class Car{
        private Framework framework;
        public Car(Framework framework) {
            this.framework = framework;
            System.out.println("创建Car~");
        }
    }

    static class Framework{
        private Bottom bottom;
        public  Framework(Bottom bottom){
            this.bottom = bottom;
            System.out.println("创建Framework~");
        }
    }

    static class Bottom{
        private Tire tire;
        public Bottom(Tire tire){
            this.tire = tire;
            System.out.println("创建Tire~");
        }
    }

    static class Tire{
        private int size;
        public Tire(int size){
            System.out.println("创建Tire~");
        }
    }
}
